home *** CD-ROM | disk | FTP | other *** search
- @echo off
- ! remove.bat Batch file to delete a folder or a file
- !
- ! remove name
- !
- ! where 'name' is the item to be deleted. The name can be preceded by
- ! a path and a volume ID.
- !
- ! remove.bat calls deldir
- !
- ! Copyright © 1994 by Rainbow Hill Pty Ltd. All rights reserved.
- !
-
- ! ensure that the first parameter is there and that the second one is not
- set doserr=13
- if not "%2 " == " " goto ERR_LBL
- if "%1 " == " " goto ERR_LBL
-
- ! do the deleting
- onerror ERR_LBL
- if not existdir "%1" goto DEL_FILE_LBL
- deldir "%1"
- goto DONE_LBL
- :DEL_FILE_LBL
- del "%1"
- goto DONE_LBL
-
- :ERR_LBL
- show %doserr%
-
- :DONE_LBL
-